<div id="left-col">
    <div class="wrap">
        <div class="container">
            <div class="inside">

            </div>
        </div>
    </div>
</div>
<div id="right-col">

    <div class="wrap">
        <div class="container">


            <div id="breadcrumb" style="display:none;"><span style="padding-left:10px;font-size:10px;color:#777777;" id="alsoviewing"></span></div>
            <div class="inside">
                <h1>Dash board</h1>
                <br/>
                <div id="search" style="width:45%;">
                    <fieldset style="border: 1px solid #DDDDDD; border-radius: 7px 7px 7px 7px; margin: 0 0 10px; padding: 8px;">
                        <legend style="padding:1px;">&nbsp;Quick Search </legend>
                        <div class="row" style="padding:10px;">
                            <?php echo CHtml::textField('entityId','',array('size'=>30,'maxlength'=>75)); ?>
                            <?php echo CHtml::dropDownList('entityName','',
                                array(
				    "job" => "Job",
                                    "invoices" => "Invoice/Sales Order/Quotation",
                                    "contract" => "Contract",
 				    "dispatch" => "Dispatch"
                                ),
                                array("prompt" => "Please Select")

                            );
                            ?>
                            <?php echo CHtml::button("Go", array("id"=>"searchGo"))?>

                        </div>
                    </fieldset>
                </div>
                <br/>
                <?php if(DateUtil::haveDateSet()):?>
                    <div id="search" style="width:45%;">
                        <fieldset style="border: 1px solid #DDDDDD; border-radius: 7px 7px 7px 7px; margin: 0 0 10px; padding: 8px;">
                            <legend style="padding:1px;">Warning</legend>
                            <div class="row" style="padding:10px;">
                                Warning: Date and time has been hardcode in Customer Connect<br/>
                                Date: <?php echo DateUtil::HARDCODE_DATE; ?><br/>
                                Time: <?php echo DateUtil::HARDCODE_TIME; ?><br/>
                            </div>
                        </fieldset>
                    </div>
                <?php endif; ?>
            </div><!-- inside -->
        </div><!-- container -->
    </div><!-- wrap -->
    <?php $this->renderPartial('application.views.copyright'); ?>
</div> <!-- left-col -->
<?php
Yii::app()->clientScript->registerScript('search',"
$('#searchGo').click(function(){
	var entityName = $('#entityName option:selected').val();
	var entityId = $('#entityId').val();
	$.get('index.php?r=customerportal/Customers/entitySearch',
		{
			entityName : entityName,
			entityId : entityId
		},
	 	function(resp,status) {
			if(resp.success) {	
				window.location.href = resp.url;
			} else {
				alert(resp.errorMsg);
			}
		},
		'json'
	);
});
");
?>
